<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <!-- Import style -->
    <link rel="stylesheet" href="./static/element-plus/index.css" />
    <!-- Import Vue 3 -->
    <script src="./static/js/vue.global.js"></script>
    <!-- Import component library -->
    <script src="./static/element-plus/index.full.js"></script>
    <script src="./static/element-plus/theme-chalk/display.css"></script>
  </head>
  <body>
    <div id="app">
      <el-container>
        <el-header>
        <el-row>
           <el-col :span="4" style="display: flex; flex-direction: row;align-items: center;"> 
            <img src="./static/images/logo.png" style="height: 60px;"/>
            <h2 style="padding-left: 6px;">技术社区</h2>
           </el-col>
           <el-col :span="8">
            <el-menu
              :default-active="activeIndex"
              class="el-menu-demo"
              mode="horizontal"
              @select="handleSelect"
              style="border-bottom: none !important;"
            >
              <el-menu-item index="1">首页</el-menu-item>
              <el-menu-item index="2">文章</el-menu-item>
              <el-menu-item index="3">课程</el-menu-item>
              <el-menu-item index="4">商城</el-menu-item>
            </el-menu>
           </el-col>
           <el-col :span="8" style="height: 60px;line-height: 60px;" class="hidden-xs-only">
            <el-input />
           </el-col>
           <el-col :span="4" v-if="isLoggendIn" style="text-align: right; height: 60px; line-height: 60px" class="hidden-only-sm;">
            <el-link type="primary"><a href="login.html" style="text-decoration: none; color: black;">登录</a></el-link>
            <el-link type="primary" style="padding-left: 10px"><a href="reg.html" style="text-decoration: none; color: black;">注册</a></el-link>
        </el-col>
        <el-col :span="4" v-else style="text-align: right; height: 60px; line-height: 60px" class="hidden-only-sm;">
            <el-link type="primary"><img src="./static/images/avatar.png" style="height: 60px; border-radius: 50%;"></el-link>
            <el-link type="primary" style="padding-left: 10px"><a href="person.html" style="text-decoration: none; ">个人中心</a></el-link> 
        </el-col>
        </el-row>
        </el-header>
        <el-main>
          <el-carousel height="420px">
            <el-carousel-item>
              <img src="./static/images/carousel1.png" width="100%" height="100%" alt="carousel1"/>
            </el-carousel-item>
            <el-carousel-item>
              <img src="./static/images/carousel2.png" width="100%" height="100%" alt="carousel2"/>
            </el-carousel-item>
            <el-carousel-item>
              <img src="./static/images/carousel3.png" width="100%" height="100%" alt="carousel3"/>
            </el-carousel-item>
          </el-carousel>
        </el-main>
        <el-main>
          <el-row>
            <el-col :span="8">
              <el-card>
                <h3>热门文章</h3>
                <el-list v-for="article in articles" :key="article.id">
                  <el-list-item>
                    <p><el-link :href="article.url">{{ article.title }}</el-link></p>
                  </el-list-item>
                </el-list>
              </el-card>
            </el-col>
            <el-col :span="8">
              <el-card>
                <h3>热门课程</h3>
                <el-list v-for="course in courses" :key="course.id">
                  <el-list-item>
                    <p><el-link :href="course.url">{{ course.title }}</el-link></p>
                  </el-list-item>
                </el-list>
              </el-card>
            </el-col>
            <el-col :span="8">
              <el-card>
                <h3>热门商品</h3>
                <el-carousel :interval="4000" type="card" height="200px">
                  <el-carousel-item v-for="product in products" :key="product.id">
                    <el-link :href="product.url">
                      <el-image :src="'./static/images/' + product.image" fit="contain"></el-image>
                      <div>{{ product.title }}</div>
                    </el-link>
                  </el-carousel-item>
                </el-carousel>
              </el-card>
            </el-col>
          </el-row>
        </el-main>
        <el-footer>
          <el-row>
            <el-col :xs="24" :lg="8" style="display: flex; flex-direction: row; align-items: center">
              <div>
                <img src="./static/images/logo.png" style="height: 100px" />
              </div>
              <div>
                <h2 style="padding-left: 4px">技术社区</h2>
                <p style="padding-left: 4px">致力构建一个专业的IT技术交流社区</p>
              </div>
            </el-col>
            <el-col :xs="24" :lg="10" style="padding-top: 30px;">
              <div>
                <el-link type="primary" style="padding-left: 50px">首页</el-link>
                <el-link type="primary" style="padding-left: 70px">咨询</el-link>
                <el-link type="primary" style="padding-left: 80px">课程</el-link>
                <el-link type="primary" style="padding-left: 80px">商城</el-link>
              </div>
              <div>
                <el-link type="primary" style="padding-left: 30px">关于我们</el-link>
                <el-link type="primary" style="padding-left: 50px">使用手册</el-link>
                <el-link type="primary" style="padding-left: 50px">隐私条款</el-link>
                <el-link type="primary" style="padding-left: 50px">建议反馈</el-link>
              </div>
            </el-col>
            <el-col :xs="24" :lg="6">
              <div>
                <h2>联系我们</h2>
                <p>电话：123456789</p>
                <p>邮箱：software@develop.com</p>
              </div>
            </el-col>
            <el-col :xs="24" :lg="24" style="background-color: deepskyblue;">
                <p style="text-align: center;">软件开发工作室版权所有</p>
            </el-col>
          </el-row>
        </el-footer>
      </el-container>
    </div>
  </body>
  <script>
    var App = {
      data() {
        return {
          msg: "hello world",
          activeIndex: 1,
          isLoggendIn: false,
          articles: [
        { id: 1, title: "vue3.0新特性使用攻略", url: "article1.html" },
        { id: 2, title: "vue脚手架使用详解", url: "article2.html" },
        { id: 3, title: "Element Plus组件库使用指南", url: "article3.html" },
      ],
      courses: [
        { id: 1, title: "零基础学JavaScript", url: "course1.html" },
        { id: 2, title: "Vue3.0从入门到精通", url: "course2.html" },
        { id: 3, title: "Element Plus组件库实战", url: "course3.html" },
      ],
      products: [
        { id: 1, title: "", url: "product1.html", image: "product01.png" },
        { id: 2, title: "", url: "product2.html", image: "product02.png" },
        { id: 3, title: "", url: "product3.html", image: "product03.png" },
      ],
        };
      },
      methods: {
    handleSelect(key, keyPath) {
      console.log(key, keyPath);
    },
  },
    };
    Vue.createApp(App).use(ElementPlus).mount("#app");
  </script>
</html>
